package com.jiangxjsy.crm.client;

import com.jiangxjsy.core.wrap.Result;
import com.jiangxjsy.core.wrap.ResultBuilder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.List;

/**
 * wukong-crm-master
 * 蒋胜宇
 * 2025/6/18 14:55
 */

@FeignClient(name = "examine", fallback = ExamineClient.ExamineClientFallback.class)
public interface ExamineClient {
    /**
     * 查询待审核的crmId
     *
     * @param label label
     * @param status 状态
     * @return crmId列表
     */
    @PostMapping("/examineWaiting/queryCrmExamineIdList")
    Result<List<Integer>> queryCrmExamineIdList(@RequestParam("label") Integer label, @RequestParam("status") Integer status);


    @Component
    class ExamineClientFallback implements ExamineClient {
        /**
         * 查询待审核的crmId
         *
         * @param label label
         * @param status 状态
         * @return crmId列表
         */
        @Override
        public Result<List<Integer>> queryCrmExamineIdList(Integer label, Integer status) {
            return ResultBuilder.ok(new ArrayList<>());
        }
    }
}
